package com.ls.fw.data.hbase.utils;

import java.util.IdentityHashMap;
import java.util.Map;

import com.ls.fw.data.hbase.constant.MasterJMXEnum;
import com.ls.fw.data.hbase.constant.RegionServerJMXEnum;
import com.ls.fw.net.httpclient.utils.HttpclientUtil;

public class HBaseClientUtils {

	public static final String QRY = "qry";
	public static String masterJVM(String url) throws Exception{
		Map<String,String> paraMap  = new IdentityHashMap<String,String>();
		paraMap.put(QRY, MasterJMXEnum.JvmMetrics.code());
		return HttpclientUtil.get(url, paraMap);
	}
	public static String masterSystem(String url) throws Exception{
		Map<String,String> paraMap  = new IdentityHashMap<String,String>();
		paraMap.put(QRY, MasterJMXEnum.OperatingSystem.code());
		return HttpclientUtil.get(url, paraMap);
	}
	public static String masterInfo(String url) throws Exception{
		Map<String,String> paraMap  = new IdentityHashMap<String,String>();
		paraMap.put(QRY, MasterJMXEnum.INFO.code());
		return HttpclientUtil.get(url, paraMap);
	}
	
	public static String regionServerJVM(String url) throws Exception{
		Map<String,String> paraMap  = new IdentityHashMap<String,String>();
		paraMap.put(QRY, RegionServerJMXEnum.JvmMetrics.code());
		return HttpclientUtil.get(url, paraMap);
	}
	public static String regionServerSystem(String url) throws Exception{
		Map<String,String> paraMap  = new IdentityHashMap<String,String>();
		paraMap.put(QRY, RegionServerJMXEnum.OperatingSystem.code());
		return HttpclientUtil.get(url, paraMap);
	}
	public static String regionServerInfo(String url) throws Exception{
		Map<String,String> paraMap  = new IdentityHashMap<String,String>();
		paraMap.put(QRY, RegionServerJMXEnum.INFO.code());
		return HttpclientUtil.get(url, paraMap);
	}
}
